<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/24
 * Time: 15:59
 * Email：290776006@qq.com
 */

namespace app\index\model;
use think\Model;

class vo_config extends Model
{
    protected $table = 'vo_config';

    public function get_count()
    {
        return $this->count();
    }

    public function get_config()
    {
        return $this->field('key, value, desc')->select();
    }

    public function update_config($key, $value, $desc)
    {
        $data = [
            'value' => $value,
            'desc' => $desc
        ];
        return $this->where('key', '=', $key)->data($data)->update();
    }
}